<?php
/**
 * The CRMUser form, used for creation and edition
 * @package ModuleAdministratif
 * @version 1.0b
 */
?>

<form action="index.php" method ="post" class="form-crud">
<table cellpadding="0" cellspacing="0" border="0" class="form">
	<tr>
		<td class="form-crud-label" colspan="4"><h3 class="subtitle"><?php echo ($_GET['operation'] == 'edit') ? 'Utilisateur '.$contact->lastname.' '.$contact->firstname : 'Nouvel Utilisateur'; ?></h3></td>
	<tr>
	<tr>
		<td class="form-crud-label"><label for="crmuser-login">Utilisateur :</label></td>
		<td class="form-crud-input"><input type="text" name="crmuser-login" value="<?php echo $crmuser->login; ?>" /></td>
		<td class="form-crud-label"><label for="crmuser-credentials">Rôle :</label></td>
		<td class="form-crud-input"><input type="text" name="crmuser-credentials" value="<?php echo $credentials->name ?>" readonly="readonly" /></td>
		
	</tr>
	<tr>
		<td class="form-crud-label"><label for="crmuser-password">Mot de passe :</label></td>
		<td class="form-crud-input"><input type="password" name="crmuser-password" value="" /></td>
		<td class="form-crud-label"><label for="crmuser-confirmation">Confirmation :</label></td>
		<td class="form-crud-input"><input type="password" name="crmuser-confirmation" value="" /></td>
	</tr>
	<tr>
		<td class="form-crud-label"><label for="crmuser-contact">Contact associé :</label></td>
		<td class="form-crud-input"><input type="text" name="crmuser-contact" value="<?php echo $contact->lastname.' '.$contact->firstname; ?>" readonly="readonly" /></td>
		<td class="form-crud-label"></td>
		<td class="form-crud-input"></td>
	</tr>
</table>
<br />
<input type="hidden" value="<?php echo $crmuser->crmuserId; ?>" name="crmuser-crmuserId" />
<input type="hidden" value="<?php echo $crmuser->contactId; ?>" name="crmuser-contactId" />
<input type="hidden" value="<?php echo $crmuser->credentialsId; ?>" name="crmuser-credentialsId" />
<input type="hidden" value="<?php echo $_GET['operation']; ?>" name="crmuser-operation" />
<a href="#" id="form-crmuser" class="submit">Sauvegarder</a>

</form>

<div id="result"></div>

<div id="select_contact" class="hidden"></div>
<div id="select_credentials" class="hidden"></div>